package ${package};

import com.ilxqx.framework.system.form.search.annotation.Condition;
import com.ilxqx.framework.system.form.SearchForm;
<#list table.getFields() as field>
<#if field.getRules().match("enum")>
import ${field.getType().getName()};
</#if>
</#list>
import com.ilxqx.framework.system.strategy.search.*;
import lombok.Data;

/**
 * ${table.getComment()}搜索表单类
 * @author venus
 */
@Data
public class ${table.getCamelName()}SearchForm implements SearchForm {

	<#list table.getFields() as field>
    <#if field.getRules().match("search")>
    /**
	 * ${field.getComment()}
	 */
    <#if field.getRules().getRule("search").getParam("condition")??>
	<#if field.getRules().getRule("search").getParam("condition") == "like">
	<#-- like比较 -->
	@Condition(conditionStrategy = LikeConditionStrategy.class)
	<#elseif field.getRules().getRule("search").getParam("condition") == "eq">
	@Condition
	<#elseif field.getRules().getRule("search").getParam("condition") == "neq">
	@Condition(conditionStrategy = NotEqualConditionStrategy.class)
	<#elseif field.getRules().getRule("search").getParam("condition") == "gt">
	@Condition(conditionStrategy = GreaterThanConditionStrategy.class)
	<#elseif field.getRules().getRule("search").getParam("condition") == "gte">
	@Condition(conditionStrategy = GreaterThanOrEqualConditionStrategy.class)
	<#elseif field.getRules().getRule("search").getParam("condition") == "lt">
	@Condition(conditionStrategy = LessThanConditionStrategy.class)
	<#elseif field.getRules().getRule("search").getParam("condition") == "lte">
	@Condition(conditionStrategy = LessThanOrEqualConditionStrategy.class)
	</#if>
	<#else>
	<#-- 自动推断 -->
	<#if field.getType().getSimpleName() == "String" && !field.getRules().match("enum")>
	@Condition(conditionStrategy = LikeConditionStrategy.class)
	<#else>
	@Condition
	</#if>
	</#if>
	private ${field.getType().getSimpleName()} ${field.getLowerCamelName()};

    </#if>
    </#list>

}
